package com.boot.rabbit;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by Wuxiang on 2017/7/22.
 * 消息消费者Receiver
 *
 * @RabbitListener注解 定义该类对hello队列的监听
 * @RabbitHandler注解 来指定对消息的处理方法。
 */
@Component
@RabbitListener(queues = "hello")
public class Receiver {
    @RabbitHandler
    public void process(String hello) {
        System.out.println("Receiver : " + hello);
    }
}